package threaddemo;

public class RunnableDemo implements  Runnable{
        //设置名字
    @Override
    public void run() {
        //currentThread() 获取当前正在执行的线程对象
        Thread thread = Thread.currentThread();
        String name = thread.getName();
        System.out.println(name);
        System.out.println("设置名字");
    }
}
